from collections import deque

class CircularQueue:
    def __init__(self, capacity):
        self.capacity = capacity
        self.deque = deque()

    def enqueue(self, value):
        if len(self.deque) >= self.capacity:
            raise Exception("Queue is full")
        self.deque.append(value)

    def dequeue(self):
        if len(self.deque) < 1:
            raise Exception("Queue is empty")
        return self.deque.popleft()

    def peek(self):
        if len(self.deque) < 1:
            raise Exception("Queue is empty")
        return self.deque[0]

    def is_empty(self):
        return len(self.deque) == 0

    def size(self):
        return len(self.deque)